package com.lqq.designPattern.bulider_pattern.singleton.demo9;

import java.io.IOException;
import java.io.InputStream;

public class RuntimeDemo {
    public static void main(String[] args) throws IOException {
        //Runtime是一个单例类
        Runtime runtime = Runtime.getRuntime();
        //参数需要一个命令
        Process process = runtime.exec("ipconfig");
        //调用process对象获取输入流的方法
        InputStream is = process.getInputStream();
        byte[] bytes = new byte[1024 * 1024 * 100];
        //读取数据
        int len = is.read(bytes);//返回读取到的字节个数
        System.out.println(new String(bytes,0, len, "GBK"));

    }
}
